package com.cloud.user.feign.fallback;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.slf4j.LoggerFactory;
@Slf4j
public class TestServiceFallback implements FallbackFactory {

    public static final String ERR_MSG = "Test接口暂时不可用: ";


    @Override
    public Object create(Throwable throwable) {
        String msg = throwable == null ? "" : throwable.getMessage();

        if (!StringUtils.isEmpty(msg)) {
            log.error(msg);
        }
        return null;
    }


}
